<!DOCTYPE html>
<html>
<head>
<title>待初审标信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">
</head>
<body style="padding:0 20px;" >
    <div class="easyui-layout" data-options="fit : true,border : false">
        <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
            <div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder="输入借款标题/借款人姓名/用户名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
                    <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <div class="sRight">
            	<a id="a" onclick="$.fn.dataGridOptions.addBorrowFun(param,addTitle,winWidth,winHeight,addUrl);" href="javascript:void(0);" class="addBtn"><i class="iconfont">&#xe629;</i>发标</a>
				<select name="type" id="type">
				<#list borrowConfigList as item>
		             <option value="${item.id}">${item.name}</option>
		        </#list>	
		        </select>
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
		        	<li><span>标的类型</span><select name="type" class="type"><option value="全部">全部</option><#list borrowConfigList as item><option value="${item.id}">${item.name}</option></#list></select></li>
		       		<li><span>借款人姓名</span><input type="text" name="realName" autocomplete="off"/></li>
		       		<li><span>用户名</span><input type="text" name="userName" autocomplete="off"/></li>
		       		<li><span>时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/></li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
        </div>
        <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
            <table id="dataGrid"></table>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    //$.fn.iframeWidthResize(640);//页面最小宽度设置
    var dataGrid;
    var winWidth =  800;
    var winHeight = 600;
    var param = document.getElementById("type").value;
    var addTitle = "发布借款";
    var addUrl =  "/modules/loan/borrow/borrowAddPage.html";
    var confirmTitle = "登记标";
    var confirmUrl = "/modules/loan/borrow/registerBorrowResult.html";
    var openUrl= "/modules/loan/borrow/registerBorrow.html";
    var registerBorrowParmeters = "'{0}','"+confirmUrl+"','" + openUrl+"'";
    var updateTitle = "修改借款";
    var updateUrl = "/modules/loan/borrow/borrowUpdatePage.html"
    
    var verifyTitle = "初审";
    var verifyUrl =  "/modules/loan/borrow/borrowVerifyPageBz.html";
    var verifyWinParmeters = "'{0}','"+verifyTitle+"',700,530,'"+verifyUrl+"'";
    var detailTitle = "查看借款信息";
    var detailUrl = "/modules/loan/borrow/borrowDetailPage.html"
    
    $(function() {
    	$("#type").change(function(){
    		$("#a").attr("onclick","$.fn.dataGridOptions.addBorrowFun("+$(this).val()+",addTitle,winWidth,winHeight,addUrl);");
    	});
        dataGrid = $('#dataGrid').datagrid({
            url : 'verifyBorrowList.html',
            fit : true,
            fitColumns : true,
            border : false,
            pagination : true,
            idField : 'id',
            pageSize : pageSize,
            pageNums :1,
            pageList : pageList,
            sortName : 'id',
            sortOrder : 'asc',
            checkOnSelect : false,
            selectOnCheck : false,
            nowrap : false,
			singleSelect:true,
            columns : [ [
	   		  { field: 'id', title: '编号', width: 50,fixed:true, sortable:false },              
              { field: 'userName', title: '用户名', width: 100,fixed:true, sortable:false },
              { field: 'realName', title: '借款人姓名', width: 100,fixed:true, sortable:false },
              { field: 'name', title: '借款标题', width: 150, sortable:false },   
              { field: 'type', title: '类型', width: 60, sortable:false , 
					formatter: function(value,row,index){
						return borrowType(value);  
    				}
              },
              { field: 'account', title: '借款金额(元)', width: 80, sortable:false },
              { field: 'apr', title: '利率(%)', width: 50, sortable:false }, 
              { field: 'timeLimitTip', title: '期限', width: 50, sortable:false },
              { field: 'borrowUse', title: '借款用途', width: 80, sortable:false },
              { field : 'showInfo',
                  title : '其他信息',
                  width :75,
                  align:'center',
                  fixed:true,
                  formatter : function(value, row, index) {
                	  var mostAccount = row.mostAccount;
                	  if(mostAccount == 0){
                		  mostAccount = '无限制';
                	  }
                	  var content = '<a href="javascript:void(0);" class="j-showInfo">查看<i class="iconfont">&#xe639;</i></a>'
							+ '<div class="showInfoSingleDiv">'
							+ '<div class="showInfo">'
							+ '<em></em><h2>借款标信息</h2>'
							+ '<ul>'
	  						+ '<li>'
	                  		+ '<span>最低投标金额：</span>'
	  						+ row.lowestAccount
	  						+ '</li>'
	  						+ '<li>'
	                  		+ '<span>最多投标金额：</span>'
	  						+ mostAccount
	  						+ '</li>'
	  						+ '<li>'
	                  		+ '<span>添加时间：</span>'
	  						+ getLocalTime(row.addTime, 4);
	  						+ '</li>'
	  						+ '<li>'
	                  		+ '<span>添加时间：</span>'
	  						+ getLocalTime(row.addTime, 4);
	  						+ '</li>'
	  						+ '<li>'
	                  		+ '<span>开标时间：</span>'
	  						+ getLocalTime(row.putStartTime, 4);
	  						+ '</li>'
	  						+ '<li>'
	                  		+ '<span>IP：</span>'
	  						+ row.addIp
	  						+ '</li>'
	  						+ '</ul></div></div>';
	  					return content;
	  				}
	  			},
              
              { field : 'action',
                title : '操作',
                width :75,
                align:'center',
                fixed:true,
                formatter : function(value, row, index) {
                    var str = '';
                    str += '<dl>';
                    str += '<dt><a href="javascript:void(0);" onclick="$.fn.dataGridOptions.editFun('+row.id+',verifyTitle,winWidth,winHeight,verifyUrl);" title="'+verifyTitle+'">初审</a><i class="iconfont">&#xe639;</i></dt>' ;
                    str += '<dd>';
                    str += '<a href="javascript:void(0);" onclick="$.fn.formOptions.viewFun('+row.id+',detailTitle,winWidth,winHeight,detailUrl);" title="'+detailTitle+'">查看</a>' ;
                    if(row.status == 0){
                        str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.borroweditFun('+row.id+',updateTitle,winWidth,winHeight,updateUrl);" title="'+updateTitle+'">修改</a>';
                    }
                    str += '</dd>'
                    str +=  '</dl>'
                    return str;
                }
            } ] ],
            toolbar : '#toolbar'
        });
    });
</script>
<script src="${theme_dir}/js/search.js"></script>

